#pragma once

#include <Runtime/Core/Core.h>

#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#define GLFW_EXPOSE_NATIVE_WIN32
#include <GLFW/glfw3native.h>

#include <DirectXMath.h>
#include <string>
#include <memory>
using namespace DirectX;

#include <Runtime/Graphics/Swapchain/Swapchain.h>

class Window {
public:
	Window();
	Window(const Window&) = delete;
	Window& operator=(const Window&) = delete;
	~Window();

	void ProcessMessage();
	XMINT2& GetPosition() noexcept { return mPosition; }
	XMINT2& GetWindowSize() noexcept { return mWindowSize; }
	GLFWwindow* GetWindowHandler() noexcept { return mWindow; }
	HWND GetWindowNativeHandler() noexcept { return glfwGetWin32Window(mWindow); }

	void SetSwapchain(std::shared_ptr<Swapchain> swapchain) { mSwapchain == swapchain; }
	Swapchain* GetSwapchain() { return mSwapchain.get(); }

	bool IsOpen() noexcept { return !glfwWindowShouldClose(mWindow); }
	bool IsFullscreen() const noexcept { return mIsFullscreen; }

public:
	XMINT2 mWindowSize;
private:
	std::string mTitle;
	XMINT2 mPosition;

	GLFWwindow* mWindow;
	bool mIsFullscreen;
	std::shared_ptr<Swapchain> mSwapchain;
	
};